<?php

function WebWheel_block_parse($file, $block, ) {

}

function WebWheel_block_parse_file($file) {

    $fd = fopen($file, "r");
    $f = fread($fd, filesize($file));
    fclose($fd);

    return $f;
}

class WebWheel {

    public $template_dir;
    public $compile_dir;

    private $vars = [];

    public function assign($key, &$val) {
        $this->vars[$key] = &$val;
    }

    public function display($template_file) {

        foreach ($this->vars as $k => &$v) {
            $$k = &$v;
        }

        $ffi = finfo_open(FILEINFO_MIME_ENCODING);
        $enc = finfo_file($ffi, $template_file);
        finfo_close($ffi);


        $f = mb_convert_encoding($f, $enc, $enc);
        //header("encoding", "gbk");
//        mb_internal_encoding("gbk");
        echo $enc;
        echo $f;
        echo $hello;
        echo $hell;
    }
}